--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
 
ENTITY test_shifter_32bits IS
END test_shifter_32bits;
 
ARCHITECTURE behavior OF test_shifter_32bits IS 
 
    -- Component Declaration for the Unit Under Test (UUT)
 
    COMPONENT shifter_32bits
    PORT(
         input : IN  std_logic_vector(31 downto 0);
         shift_value : IN  std_logic_vector(4 downto 0);
         operation : IN  std_logic_vector(1 downto 0);
         output : OUT  std_logic_vector(31 downto 0)
        );
    END COMPONENT;
    

   --Inputs
   signal input : std_logic_vector(31 downto 0) := "11110000111100001111000011110000";
   signal shift_value : std_logic_vector(4 downto 0) := (others => '0');
   signal operation : std_logic_vector(1 downto 0) := (others => '0');

 	--Outputs
   signal output : std_logic_vector(31 downto 0);
   -- No clocks detected in port list. Replace <clock> below with 
   -- appropriate port name 
 
--   constant <clock>_period : time := 10 ns;
 
BEGIN
 
	-- Instantiate the Unit Under Test (UUT)
   uut: shifter_32bits PORT MAP (
          input => input,
          shift_value => shift_value,
          operation => operation,
          output => output
        );

   -- Clock process definitions
--   <clock>_process :process
--   begin
--		<clock> <= '0';
--		wait for <clock>_period/2;
--		<clock> <= '1';
--		wait for <clock>_period/2;
--   end process;
-- 

   -- Stimulus process
   stim_proc: process
   begin		
      -- hold reset state for 100 ns.
      wait for 100 ns;	

--      wait for <clock>_period*10;

      -- insert stimulus here 
		shift_value <= "00001";
		operation <= "00";
		wait for 50 ns;
		operation <= "01";
		wait for 50 ns;
		operation <= "10";
		wait for 50 ns;
		operation <= "11";
		wait for 50 ns;
		shift_value <= "00010";
		operation <= "00";
		wait for 50 ns;
		operation <= "01";
		wait for 50 ns;
		operation <= "10";
		wait for 50 ns;
		operation <= "11";
		wait for 50 ns;
		shift_value <= "00011";
		operation <= "00";
		wait for 50 ns;
		operation <= "01";
		wait for 50 ns;
		operation <= "10";
		wait for 50 ns;
		operation <= "11";
		wait for 50 ns;
		
		input <= ("00001111000011110000111100001111");
		shift_value <= "01000";
		operation <= "00";
		wait for 50 ns;
		operation <= "01";
		wait for 50 ns;
		operation <= "10";
		wait for 50 ns;
		operation <= "11";
		wait for 50 ns;
		shift_value <= "00100";
		operation <= "00";
		wait for 50 ns;
		operation <= "01";
		wait for 50 ns;
		operation <= "10";
		wait for 50 ns;
		operation <= "11";
		wait for 50 ns;
		shift_value <= "11111";
		operation <= "00";
		wait for 50 ns;
		operation <= "01";
		wait for 50 ns;
		operation <= "10";
		wait for 50 ns;
		operation <= "11";
		wait for 50 ns;
      wait;
   end process;

END;
